#ifndef Locker_h
#define Locker_h

/*
#include <SDL/SDL.h>
#include <SDL/SDL_thread.h>

class Locker {
public:
	Locker()
	{
		m_mutex = SDL_CreateMutex();
	}
	~Locker()
	{
		SDL_DestroyMutex(m_mutex);
	}
	void Lock()
	{
		SDL_mutexP(m_mutex);
	}
	void Unlock()
	{
		SDL_mutexV(m_mutex);
	}
protected:
	SDL_mutex* m_mutex;
};

*/
#include <pthread.h>

class Locker {
protected:
	pthread_mutex_t m_mutex;
public:
	Locker()
	{
		pthread_mutex_init (&m_mutex, NULL);
	}
	void Lock()
	{
		pthread_mutex_lock(&m_mutex);
	}
	void Unlock()
	{
		pthread_mutex_unlock(&m_mutex);
	}
};


#endif
